import { Random } from 'mockjs';
import { Mod } from '../src/utils/model';

const model = new Mod('users');

export default {
  async up() {
    const array = [];
    for (let i = 0; i < 1; i++) {
      const item = {
        openid: Random.word(28, 28),
        tag: ['抄编译原理作业'],
        nickname: Random.cname(),
        head_image: 'https://img.yzcdn.cn/vant/cat.jpeg',
        property: {
          tomato: Random.integer(10, 100),
        },
        allow_stop: Random.boolean(),
        ty_symbol: true,
      };
      array.push(item);
    }
    await model.insertMany(array);
  },
  async down() {
    await model.deleteMany({
      ty_symbol: true,
    });
  },
};
